# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=tree-sitter-nix
pkgver=0_git20230713
_gitrev=66e3e9ce9180ae08fc57372061006ef83f0abde7
pkgrel=0
pkgdesc="Nix grammar for tree-sitter"
url="https://github.com/nix-community/tree-sitter-nix"
arch="all"
license="MIT"
makedepends="tree-sitter-dev"
subpackages="$pkgname-doc"
install_if="tree-sitter-grammars"
source="$pkgname-$_gitrev.tar.gz::https://github.com/nix-community/tree-sitter-nix/archive/$_gitrev.tar.gz"
builddir="$srcdir/$pkgname-$_gitrev"
options="!check"  # no tests for shared lib

build() {
	abuild-tree-sitter build
}

package() {
	DESTDIR="$pkgdir" abuild-tree-sitter install
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
9f2d3f44af8b0c4b17aae83112fdaa15e945e5cdd0938bc4f1043dfac762ba9d56e7e8f575d62dfbacc57447443cca7b9ff93ecc72721d393d25d3a2761891f9  tree-sitter-nix-66e3e9ce9180ae08fc57372061006ef83f0abde7.tar.gz
"
